package com.graduation.springbootinit.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.graduation.springbootinit.model.entity.ShopPart.Order;
import com.graduation.springbootinit.model.vo.OrderDetailVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface OrderMapper extends BaseMapper<Order> {
    @Select("SELECT o.*, a.* " +
            "FROM shop_part_orders o " +
            "LEFT JOIN shop_part_shipping_addresses a ON o.address_id = a.id " +
            "WHERE o.id = #{orderId}")
    OrderDetailVO selectOrderDetail(@Param("orderId") Long orderId);
} 